package com.authine.cloudpivot.app.openapi.service;

import com.alibaba.cola.dto.Response;
import com.authine.cloudpivot.app.openapi.dto.DeleteGatewayCmd;
import com.authine.cloudpivot.app.openapi.dto.SaveGatewayRouteCmd;
import com.authine.cloudpivot.app.openapi.executor.DeleteGatewayCmdExe;
import com.authine.cloudpivot.app.openapi.executor.SaveGatewayRouteCmdExe;
import org.springframework.stereotype.Service;

/**
 * @author carter
 * create_date  2020/6/5 11:12
 * description     应用层接口实现
 */
@Service
public class RouteServiceImpl {

    private final DeleteGatewayCmdExe deleteGatewayCmdExe;
    private final SaveGatewayRouteCmdExe saveGatewayRouteCmdExe;

    public RouteServiceImpl(DeleteGatewayCmdExe deleteGatewayCmdExe, SaveGatewayRouteCmdExe saveGatewayRouteCmdExe) {
        this.deleteGatewayCmdExe = deleteGatewayCmdExe;
        this.saveGatewayRouteCmdExe = saveGatewayRouteCmdExe;
    }


    public Response add(SaveGatewayRouteCmd cmd) {

        return saveGatewayRouteCmdExe.execute(cmd);

    }

    public Response delete(DeleteGatewayCmd cmd) {

        return deleteGatewayCmdExe.execute(cmd);

    }

    public Response update(SaveGatewayRouteCmd cmd) {

        return saveGatewayRouteCmdExe.execute(cmd);

    }


}
